package com.health.system.model.system;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.health.system.javacommon.base.BaseEntity;

/**
 * <p>Title: 角色 数据类 <p>
 * <p>Description: DAO层映射到数据类,页面封装数据映射到数据类 <p>
 * Copyright: Copyright (c) 2011-03 
 * Company: 
 * 
 * @author 
 * @version 1.0 
*/

public class Role extends BaseEntity {
	
	//date formats
	
	//columns START
	/**角色ID*/
	private java.lang.String id;
	/**角色名称(角色代码)*/
	private java.lang.String name;
	/**角色描述*/
	private java.lang.String description;
	/**上级角色ID*/
	private java.lang.String higherId;
	/**上级角色名称 bzq add*/
	private java.lang.String higherName;
	/***/
	private java.util.ArrayList idList;
	//columns END

	public Role(){
	}

	public Role(
		java.lang.String id
	){
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setDescription(java.lang.String value) {
		this.description = value;
	}
	
	public java.lang.String getDescription() {
		return this.description;
	}

	public java.util.ArrayList getIdList() {
		return idList;
	}

	public void setIdList(java.util.ArrayList idList) {
		this.idList = idList;
	}

	public java.lang.String getHigherId() {
		return higherId;
	}

	public void setHigherId(java.lang.String higherId) {
		this.higherId = higherId;
	}
	public java.lang.String getHigherName() {
		return higherName;
	}

	public void setHigherName(java.lang.String higherName) {
		this.higherName = higherName;
	}
	
	
	/***/
	public String toString() {
		return new ToStringBuilder(this)
			.append("Id",getId())
			.append("Name",getName())
			.append("HigherId",getHigherId())
			.append("Description",getDescription())
			.append("HigherName",getHigherName())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.append(getName())
			.append(getDescription())
			.append(getHigherId())
			.append(getHigherName())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Role == false) return false;
		if(this == obj) return true;
		Role other = (Role)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getName(),other.getName())
			.append(getDescription(),other.getDescription())
			.append(getHigherId(),other.getHigherId())
			.append(getHigherName(),other.getHigherName())
			.isEquals();
	}

}

